package cn.com.demo.microservice.anquan.service.impl;

import cn.com.demo.microservice.anquan.mapper.AqUserMapper;
import cn.com.demo.microservice.anquan.service.IUserService;
import cn.com.demo.microservice.entity.AqUser;
import com.codingapi.txlcn.tc.annotation.DTXPropagation;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl implements IUserService {
    @Autowired
    private AqUserMapper userMapper;
    @Override
    @LcnTransaction(propagation = DTXPropagation.SUPPORTS)
    @Transactional
    public int addUser(AqUser user) {
        int urId = -1;
        this.userMapper.insert(user);
        urId = user.getUrId();
        return urId;
    }
}
